﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using S4Store.Domain.AfterSaleKpi;
using S4Store.Domain;

namespace S4Store.Models.AfterSaleCarKPI
{
    public class ServiceAdvisorIndexModel
    {
        public ServiceAdvisorIndexModel()
        {
            MonthDayData = new List<Domain.AfterSaleKpi.AfterSaleServiceAdvisorDayInput>();
        }

        public List<AfterSaleServiceAdvisorDayInput> MonthDayData { get; set; }

        public DataConfirmStatus? GetDayStatus(int year,int month,int day)
        {
            var m = MonthDayData.FirstOrDefault(t => t.AddTime.Year == year && t.AddTime.Month == month && t.AddTime.Day == day);
            if (m == null)
            {
                return null;
            }
            else if (m.IsConfirmed)
            {
                return DataConfirmStatus.Confirmed;
            }else{
                return DataConfirmStatus.None;
            }
        }
    }
}